//
//  WDCustomBtn.m
//  Zhihuijinfu
//
//  Created by 王笛 on 2017/2/26.
//  Copyright © 2017年 王笛. All rights reserved.
//

#import "WDCustomBtn.h"
static float imgWH = 80;
@implementation WDCustomBtn

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGSize size = self.imageView.image.size;
    self.imageView.frame = CGRectMake(CGRectGetWidth(self.frame) * 0.5 - size.width * 0.5, 10, size.width, size.height);
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.titleLabel.frame = CGRectMake(0, CGRectGetMaxY(self.imageView.frame) + 5, CGRectGetWidth(self.frame), 20);
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
}

@end
